package plugins.detail;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.context.RequestContext;
import kd.sdk.plugin.Plugin;

import java.util.EventObject;

/**
 * 单据界面插件
 */
public class CardHistoryInvisible_single extends AbstractBillPlugIn implements Plugin {

    @Override
    public void afterLoadData(EventObject e) {
        super.afterLoadData(e);

        // 获取当前用户名
        String currentUserName = RequestContext.get().getUserName();

        // 如果当前用户是陈旭，则隐藏特定按钮
        if ("陈旭".equals(currentUserName)) {
            this.getView().setVisible(false, "bar_new");
            this.getView().setVisible(false, "bar_delete");
            this.getView().setVisible(false, "bar_save");
            this.getView().setVisible(false, "bar_saveandnew");
            this.getView().setVisible(false, "bar_submit");
            this.getView().setVisible(false, "bar_audit");
            this.getView().setVisible(false, "bar_unaudit");
            this.getView().setVisible(false, "bar_modify");
            this.getView().setVisible(false, "bar_disable");
            this.getView().setVisible(false, "dcb4_lock");
        }
    }
}